<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/Deng.css"/>
	</head>
	<body>
		<iframe src="head.html" width="100%" height="212px" scrolling="auto" frameborder="0"></iframe>
		<div class="content">
			<div class="box">
				<div class="right">
					<div class="title">
						<span class="active">登录</span><span>注册</span>
						<script type="text/javascript">
						// 用于在网页加载完毕后立刻执行的操作
							window.onload = function(){
								var div = document.querySelector(".title");
								var spans = div.children;
								for(var i=0;i<spans.length;i++){
									spans[i].onclick=function(){
										for(var j=0;j<spans.length;j++){
											if(spans[j]!=this){
												spans[j].className="";
											}else{
												spans[j].className="active";
											}
										}
									}
								}
								console.log(spans)
							}
						</script>
					</div>
					<div class="text">
						<div class="login">
							<form action="#" method="post">
								<input type="text" name="name" placeholder="请输入账号" id="" value="" />
								<input type="password" name="pwd" placeholder="请输入密码" id="" value="" />
								<div>
									<input type="checkbox" name="chk" id="chk" value="" />
									<!-- 点击字符是checkbox也会用for对应id -->
									<label for="chk">自动登录</label>
								</div>
								<br/>
								<input type="submit" value="登录"/>
							</form>
						</div>
						<div class="register">注册表单</div>
					</div>
				</div>
			</div>
		</div>
		<iframe src="Wei.html" width="100%" height="250px" frameborder="0"></iframe>
	</body>
</html>
